<template>
	<view class="msg-wrapper" v-if="Object.keys(info) != false">
		<view class="title">{{ info.title }}</view>
		<view class="content">{{ info.content }}</view>
		<view class="desc" v-if="info.desc">
			未通过理由：{{ info?.desc }}
		</view>
		<view class="bottom-part">
			<view class="check" @click="checkDetail" v-if="info.type!=22">查看详情</view>
			<view class="time">{{ info.created_at }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			info: {
				type: Object,
				default() {
					return {}
				}
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			checkDetail() {
				const { activity_id, type } = this.info
				if (activity_id <= 0 && type != 20) {
					uni.showToast({
						title: '无效的活动id',
						icon: 'none'
					})
					return
				}
				if (type < 11) {
					uni.navigateTo({
						url: '/pages/detail/index?activityId=' + activity_id
					})
					return
				}
				if (type == 13) {
					uni.navigateTo({
						url: '/pages/mine/petAuth?isEdit=1'
					})
					return
				}
				if (type == 11 || type == 14) {
					uni.switchTab({
						url: '/pages/mine/index'
					})
					return
				}
				if (type == 15) {
					uni.navigateTo({
						url: '/pages/mine/shopInfo'
					})
					return
				}
				if (type == 16) {
					uni.navigateTo({
						url: '/pages/mine/shopAuth?isEdit=1'
					})
					return
				}
				if (type == 21) {
					uni.navigateTo({
						url: '/pages/news/detail?newsId='+activity_id
					})
					return
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.msg-wrapper {
		padding: 24rpx 0;
		border-bottom: 1px solid #f0f0f0;
		.title {
			font-size: 30rpx;
			font-weight: 500;
		}
		.content {
			font-size: 26rpx;
			padding: 24rpx 0 20rpx;
		}
		.desc {
			font-size: 26rpx;
			color: #7b7b7b;
			padding-bottom: 8rpx;
		}
		.bottom-part {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.check {
				color: $uni-color-primary;
				font-size: 28rpx;
			}
			.time {
				font-size: 28rpx;
				color: #999;
			}
		}
	}
</style>